<%@ page language="java" %>
<%@ page session="true" %>
<%@ page import="java.sql.*,java.io.*,java.util.Random"%>
 <% String InterviewID = request.getParameter("InterviewID");%>

<HEAD>
	<title>Job Details</title>

	<script LANGUAGE="Javascript" SRC="Images/validate.js"></script>

	<SCRIPT LANGUAGE="JavaScript">
	<!--
		function applyJob(){
			var URL = "ApplyJob.jsp";
			document.forms(0).action = URL;
			document.forms(0).submit();
		}
	//-->
	</SCRIPT>
	<LINK href="styles.css" type="text/css" rel="stylesheet">

</HEAD>
<BODY class=Grad>
<h2 align=center>Job details</h2>
<FORM Name="ApplyJobForm">
<%

	Connection con=null;
	ResultSet rs=null;
	Statement stmt=null;
	try{
			
	/* Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
	con = DriverManager.getConnection("jdbc:odbc:JobPortal","root","");*/

			Class.forName("com.mysql.jdbc.Driver");
			con = DriverManager.getConnection("jdbc:mysql://localhost:3306/jobmiller","root","root");

			stmt =  con.createStatement();
			String Query = "Select * from interviewdetails where InterviewID='"+InterviewID+"'";
			rs = stmt.executeQuery(Query);}
			catch(Exception e){
			rs.close();
			stmt.close();
			con.close();
			%><%=e%><%
		}
			if(rs!=null)
{
			%>
	<!--Displaying the table header-->

	<br>
<!--	<DIV STYLE="overflow:scroll;width:650px; height:400px;">-->

	
<%
int DisRow=0;
			while(rs.next())
			{
				 InterviewID=rs.getString(1);
				String JobTitle=rs.getString(2);
				String JobDescription=rs.getString(3);
				String Eligbility=rs.getString(4); 
				String Location= rs.getString(5); 
				Date ApplyBefore=rs.getDate(6); 
				String CompanyName=rs.getString(7); 
				String CompanyProfile=rs.getString(8); 
				String EmailToApply=rs.getString(9); 
				String WebSite=rs.getString(10); 
				String ExecutiveName=rs.getString(11);
				String Address=rs.getString(12);
				int Telephone=rs.getInt(13); 
				String Fax=rs.getString(14);
				Date DateOfPosting=rs.getDate(15);
				String FunctionalArea=rs.getString(16);
				int MinExperience=rs.getInt(17); 
				int MaxExperience=rs.getInt(18); 

				DisRow++;
					%>
				<table align=center border=0  width="60%">
				 <tr>
					<td align=Left style="background-color:#82C0FF" width="168" height="20"><b>Interview ID</b></td>
				 <td align=Left style="background-color:#E1E1E1" height="20"><font  color="black"><%=InterviewID%></font><INPUT TYPE="hidden" NAME="JobID" value="<%=InterviewID%>"></td></tr>
				 <tr>
					<td align=Left style="background-color:#82C0FF" width="168"><b>Job Title</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=JobTitle%></font></td></tr>
				 <tr>
					<td align=Left style="background-color:#82C0FF" width="168" ><b>Job Description</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=JobDescription%></font></td></tr>
				 <tr>
					<td align=Left style="background-color:#82C0FF" width="168" ><b>Functional Area</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=FunctionalArea%></font></td></tr>
				 <tr>
					<td align=Left style="background-color:#82C0FF" width="168"><b>
					Eligibility</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=Eligbility%></font></td></tr>
				 <tr>
					<td align=Left style="background-color:#82C0FF" width="168"><b>Location</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=Location%></font></td></tr>
				 <tr>
					<td align=Left style="background-color:#82C0FF" width="168"><b>Apply Before</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=ApplyBefore%></font></td></tr>
				 <tr>
					<td align=Left style="background-color:#82C0FF" width="168"><b>Company Name</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=CompanyName%></font></td></tr>
				 <tr>
					<td align=Left style="background-color:#82C0FF" width="168"><b>Company Profile</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=CompanyProfile%></font></td></tr>
				 <tr>
					<td align=Left style="background-color:#82C0FF" width="168"><b>Email To Apply</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=EmailToApply%></font></td></tr>
				 <tr>
					<td align=Left style="background-color:#82C0FF" width="168"><b>Web Site</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=WebSite%></font></td></tr>
				 <tr>
					<td align=Left style="background-color:#82C0FF" width="168"><b>Executive Name</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=ExecutiveName%></font></td></tr>
				 <tr>
					<td align=Left style="background-color:#82C0FF" width="168"><b>Address</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=Address%></font></td></tr>
				 <tr>
					<td align=Left style="background-color:#82C0FF" width="168"><b>Telephone</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=Telephone%></font></td></tr>
				 <tr>
					<td align=Left style="background-color:#82C0FF" width="168"><b>Fax</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=Fax%></font></td></tr>
				 <tr>
					<td align=Left style="background-color:#82C0FF" width="168"><b>Date Of Posting</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=DateOfPosting%></font></td></tr>
				<tr><td align=Left style="background-color:#82C0FF" width="168"><b>Experience</b></td>
				 <td align=Left style="background-color:#E1E1E1"><font  color="black"><%=MinExperience%>-<%=MaxExperience%></font></td></tr>	
				
			
					</tr>
					<tr><td align=center colspan='2'><input type='button' value='Close' class='Button' onclick='window.close()'></td>
					</tr>
					</table>	

	<%
	}


	rs.close();
	
if(DisRow==0)
{
	/*To write to the server if the resultset is null*/
	%>
		<CENTER>
			<tr><th colspan=6><b>
			<font face="Bookman Old Style" size="2" color="#FF00FF">No records found</th></tr></font></b><br><br>
		</CENTER>
		

	<%

}
}
%>

</table>
<%
String userid = (String)session.getAttribute("userr");
if(userid==null || userid.equals("")){
%>
	<P align=center>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<%
}else{
%>
<input type="hidden" name="userid" value="<%=userid%>">
<P align=center>&nbsp;</P>

<%
}
%>
</FORM>
</BODY>
</HTML>
